The standard AWS Lambda Python runtime is designed to invoke a synchronous handler function. While Python’s asyncio
library can be
used inside a synchronous handler, by calling asyncio.run()
, the handler function itself cannot be declared with async def
.
Doing so will lead to a runtime error.